<?php
	require_once dirname(__FILE__) . "/../../includes/config.php";
	require_once PHP_ROOTPATH.'/classes/database.php';
	//récupération du nom des onglets
	header("Content-Type: text/xml; charset=utf-8");
	echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
	echo "<list>";
	 
	$id_connect=Database::getInstance();
	
	$query_temp = "SELECT DISTINCT(description) FROM Type_test WHERE label LIKE '%Test comportemental%'";

	$res_query = pg_query($id_connect , $query_temp) or die(pg_last_error());
	$i=0;
	while ($back = pg_fetch_assoc($res_query)) {
		if($back["description"]=="Discrimination"){
			echo "<item id=\"" . $i . "\" name=\"Discrimination/Inversion\" />\n";
		}
		elseif($back["description"]=="Hourglass narrow"){
			echo "<item id=\"" . $i . "\" name=\"Hourglass\" />\n";
		}
		elseif($back["description"]=="Pairwise discrimination"){
			echo "<item id=\"" . $i . "\" name=\"Pairwise Discrimination/Inversion\" />\n";
		}
		elseif($back["description"]=="Barnes bc12"){
			echo "<item id=\"" . $i . "\" name=\"Barnes\" />\n";
		}
		elseif($back["description"]!="Inversion" && $back["description"]!="Hourglass wide" && $back["description"]!="Pairwise inversion" && $back["description"]!="Barnes bop"){
			echo "<item id=\"" . $i . "\" name=\"" . $back["description"] . "\" />\n";
		}
		$i++;
	}
									

	echo "</list>";

?>
